package com.lul15834.orderfood.bean;

import com.lul15834.orderfood.dao.AdminDao;
import com.lul15834.orderfood.dao.OrderDao;

import java.util.List;
import java.util.SplittableRandom;

public class OrderBean {
    private String orderId;
    private String orderTime;
    private String businessId;
    private String userId;
    private String orderDesId;
    private String orderSta;
    private String orderAddress;
    private  String userName;

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public List<OrderDetailBean> getOrderDetailBeans() {
        return orderDetailBeans;
    }

    public void setOrderDetailBeans(List<OrderDetailBean> orderDetailBeans) {
        this.orderDetailBeans = orderDetailBeans;
    }

    private List<OrderDetailBean> orderDetailBeans;

    public OrderBean() {
    }

    @Override
    public String toString() {
        return "OrderBean{" +
                "orderId='" + orderId + '\'' +
                ", orderTime='" + orderTime + '\'' +
                ", businessId='" + businessId + '\'' +
                ", userId='" + userId + '\'' +
                ", orderDesId='" + orderDesId + '\'' +
                ", orderSta='" + orderSta + '\'' +
                ", orderAddress='" + orderAddress + '\'' +
                '}';
    }

    public String getOrderId() {
        return orderId;
    }

    public void setOrderId(String orderId) {
        this.orderId = orderId;
    }

    public String getOrderTime() {
        return orderTime;
    }

    public void setOrderTime(String orderTime) {
        this.orderTime = orderTime;
    }

    public String getBusinessId() {
        return businessId;
    }

    public void setBusinessId(String businessId) {
        this.businessId = businessId;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public String getOrderDesId() {
        return orderDesId;
    }

    public void setOrderDesId(String orderDesId) {
        this.orderDesId = orderDesId;
    }

    public String getOrderSta() {
        return orderSta;
    }

    public void setOrderSta(String orderSta) {
        this.orderSta = orderSta;
    }

    public String getOrderAddress() {
        return orderAddress;
    }

    public void setOrderAddress(String orderAddress) {
        this.orderAddress = orderAddress;
    }
    public OrderBean(String orderId,String orderTime,String businessId,String userId,String orderDesId,String orderSta,String orderAddress) {
        this.orderDetailBeans = OrderDao.getAllOrderDetail(orderDesId);
        this.orderAddress = orderAddress;
        this.orderSta = orderSta;
        this.orderDesId = orderDesId;
        this.userId = userId;
        this.businessId = businessId;
        this.orderTime = orderTime;
        this.orderId = orderId;
        String uname=AdminDao.getComUser(userId).getsName();//用户账号昵称
        this.userName=uname;
    }
}
